<?php

namespace app\api\validate;


class BannerValidate extends BaseValidate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
        'id' => 'require|isPositiveInteger',
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [
        'id' => 'id必须为正整数'
    ];

    public function __construct ($method)
    {
        switch ($method)
        {
            case 'getBanner':
                $this->rule = [
                    'id' => 'require|isPositiveInteger',
                ];
                break;
        }
    }
}
